<template>


<div>
  <van-sticky>
    <Title></Title>
  </van-sticky>
  <Tabs @toggleBar="toggleBar"></Tabs>
  <ServicePolicy v-if="showBar == 0"></ServicePolicy>
  <NavBars v-if="showBar == 0"></NavBars>
  <FreshmanModule v-if="showBar == 0"></FreshmanModule>
  <CategoryHotSell v-if="showBar == 0"></CategoryHotSell>
  <Selectforyou v-if="showBar == 0"></Selectforyou>
  <CategoryGoodsInfo v-if="showBar !== 0" :categoryList="categoryList"></CategoryGoodsInfo>
  <van-back-top right="5vw" bottom="10vh"></van-back-top>
  <div style="height:50px;"></div>
</div>

</template>

<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({

  name: 'Home',
})


</script>
<script lang="ts" setup>
import {ref,onMounted} from "vue"
import Title from "@/views/home/title/index.vue"
import Tabs from "@/views/home/tabs/index.vue"
import ServicePolicy from "@/views/home/indexServicePolicy/index.vue"
import NavBars from "@/views/home/navBars/index.vue"
import FreshmanModule from "@/views/home/freshmanModule/index.vue"
import CategoryHotSell from "@/views/home/categoryHotSell/index.vue"
import Selectforyou from "@/views/home/SelectForYou/index.vue"
import CategoryGoodsInfo from "@/views/home/CategoryGoodsInfo/index.vue"

let showBar = ref()
let categoryList = ref([])
function toggleBar(num:number,categoryItemList:any){
  showBar.value = num
  categoryList.value = categoryItemList
}

onMounted(()=>{
  showBar.value = 0
})

</script>


<style scoped></style>

  

